package com.tuling.code.spring;

import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class ApplicationContextTest {
	@Test
	public void contextTest(){
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("user.xml");
		
		//当Bean的scipe = singleton时，创建context时就实例化了Bean
		
		//context.start();
		//User u = (User) context.getBean("user");
		//System.out.println(u.getUserId() +" : "+u.getUserName());
	}
	
	@Test
	public void adviceTest(){
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
	}
}
